# Copyright (c) 2019 Presto Labs Pte. Ltd.
# Author: jaewon

from collections import namedtuple

from experimental.prophet.graph.shape import Shape

_ArgDef = namedtuple('ArgDef', ['name', 'dtype', 'shape', 'attrs'])
_VariadicInput = 1


def arg_def(name, dtype, shape=None, attrs=None):
  shape = shape if shape is not None else Shape()
  return _ArgDef(name, dtype, shape, attrs)


def variadic_input():
  return _VariadicInput


class OpKernel:
  deprecated = False
  is_stateful = False
  support_pickling = False
  allow_null_input = False
  is_delayed_op = False

  name = None
  input_args = None
  output_args = None

  @classmethod
  def get_input_args(cls, attrs):
    return cls.input_args

  @classmethod
  def get_output_args(cls, inputs, attrs):
    return cls.output_args

  def __init__(self, attrs, node_def):
    pass

  def compute(self, inputs, outputs):
    pass

  def on_null_input(self, inputs, outputs):
    raise NotImplementedError()
